package com.etc;


import com.etc.common.TrackPoint;
import com.etc.dao.GpsDao;
import com.etc.modules.ResultModel;
import com.etc.netty.NettyServer;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.io.IOException;
import java.net.BindException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.List;

/**
 * @Author kalista
 * @Description
 * @Date 2021/5/25  22:47
 **/
@MapperScan("com.etc.dao")
@Controller
@Slf4j
@SpringBootApplication
public class AppMain {


    @Autowired
    private GpsDao gpsDao;


    public static void main(String[] args) throws IOException {
        SpringApplication.run(AppMain.class, args);
        new NettyServer(7777).start();
        log.info("****************AppMain 启动 ************ ");

    }

    @ResponseBody
    @GetMapping("/index")
    public Object index() {
        return gpsDao.findAll();
    }




}
